import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import Layout from '@/views/layout/Layout'
import AuthorityManagement from './modules/AuthorityManagement'
import ClassifiedManagement from './modules/ClassifiedManagement'
import ComprehensiveManagement from './modules/ComprehensiveManagement'
import ImgManagement from './modules/ImgManagement'
export const constantRouterMap = [
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    name: 'Dashboard',
    hidden: true,
    icon: 'el-icon-message',
    title: '首页',
    id: 0,
    children: [
      {
        path: '/dashboard',
        component: () => import('@/views/dashboard/index'),
        meta: {
          title: '首页'
        },
        hidden: true,
        icon: 'el-icon-message'
      }
    ]
  },
  AuthorityManagement,
  ClassifiedManagement,
  ComprehensiveManagement,
  ImgManagement,
  { path: '*', redirect: '/404', hidden: true }
]

export default new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
